package com.example.neusoft.a16110100126yttordering.activities;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.neusoft.a16110100126yttordering.R;
import com.example.neusoft.a16110100126yttordering.common.Constants;
import com.example.neusoft.a16110100126yttordering.listener.RetrofitListener;

public class FoodInfoActivity extends BaseActivity implements RetrofitListener {
    private ImageView imageView;
    private TextView textView1;
    private TextView textView2;
    private TextView textView3;
    private TextView textView4;
    private TextView textView5;
    private Button button;
    private Button button1;
    private Button button2;
    private RecyclerView recyclerView;
    private ImageButton imageButton;
    private ImageButton imageButton1;
    private Toolbar toolbar;
    @Override
    void initViews() {
    setLayout(R.layout.activity_food_info);

    }


    @Override
    void initEvents() {
        imageView=findViewById(R.id.imageView_food_info);
        textView1=findViewById(R.id.textView1_food_info);
        textView2=findViewById(R.id.textView2_food_info);
        textView3=findViewById(R.id.textView3_food_info);
        textView4=findViewById(R.id.textView4_food_info);
        textView5=findViewById(R.id.textView5_food_info);
        button=findViewById(R.id.button1_comment);
        button1=findViewById(R.id.button_car);
        button2=findViewById(R.id.button_buy);
        toolbar=findViewById(R.id.toolbar1);
        imageButton=findViewById(R.id.imageButton_food_info);
        imageButton1=findViewById(R.id.imageButton1_food_info);
        toolbar.setNavigationOnClickListener(view -> {
            finish();
            System.out.println("skdjfhgjfkwp[qpdkjfvbhjduk===========toolb");
        });
        imageButton1.setOnClickListener(view -> {
            System.out.println("skdjfhgjfkwp[qpdkjfvbhjduk===========tasdfgdwqs1");
                collect();
    });
        button2.setOnClickListener(view -> {
            Intent intent=new Intent(FoodInfoActivity.this,BuyActivity.class);
//            intent.putExtra("shopid",f)
    });
 }



    @Override
    void initData() {

    }
    private void showFoodInfo(int food_id){

    }
    private void showComments(){

    }
    private void iscollected(){

    }
    private void collect(){

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_food_info);
    }

    @Override
    public void onSuccess(Object o, int flag) {
            switch (flag){
                case Constants.GETFOODBYID:
                    break;
                case Constants.GETALLUSERCONNENT:
                    break;
                case Constants.ISCOLLECTED:
                    break;
                case Constants.USERCOLLECTFOOD:
                    break;
            }
    }

    @Override
    public void onFail() {
            showToast("网络连接错误");
    }
}
